A framework for describing recursive data structure topologies in Coq
نویسندگان
چکیده
This paper presents an axiomatic framework in Coq for verifying invariants on heap data structures such as lists and trees in a C-like language with a low-level store model. The goal of the framework is to detect common errors such as memory leaks, dangling pointers and looped data structures. The framework provides a language for expressing invariants, and a set of inference axioms for verifying them on code that manipulates the data structures. This work builds on the work done by Cook et al. which uses separation logic with recursive predicates to document data structure invariants. The key extension here is the ability to express and reason about data structures more complex than linked lists. The heap description includes a spatial component describing the basic set of lists and trees in the heap. New logical constructs are included to describe special pointer field invariants such as back pointers. We use the framework to formally prove in Coq the heap invariants of a small example program that generates a linked list representing the tree traversal of a tree. This proof guarantees the integrity of program’s data structures and that common errors such as memory leaks or dangling pointer references did not arise. We define the meaning of the abstract state in terms of a simpler concrete state. We also include a number of axioms for reasoning about the abstract state that are used in the Coq verification. Proving soundness of these abstract axioms in Coq remains future work.
منابع مشابه
Refinements to techniques for verifying shape analysis invariants in Coq
We describe the PEDANTIC framework for verifying the correctness of C-like programs using Coq. PEDANTIC is designed to prove invariants over complex dynamic data structures such as interreferencing trees and linked lists. The PEDANTIC tactic library has been constructed to allow program verifications to be done with reasonably compact proofs. We introduce a couple of important innovations. Firs...
متن کاملA New Doubly Segmented Structure for Switched Reluctance Motors with High Torque Capability
In this paper, a new magnetic structure for switched reluctance motors is presented. In this structure, both stator and rotor has a segmented topology and there is no magnetic flux path between two stator/rotor segments or any possible combination of them. The proposed segmental structure may be considered with different number of phases as well as different number of segments per phase for any...
متن کاملA Framework for Verifying Data-Centric Protocols
Data centric languages, such as recursive rule based languages, have been proposed to program distributed applications over networks. They simplify greatly the code, while still admitting efficient distributed execution. We show that they also provide a promising approach to the verification of distributed protocols, thanks to their data centric orientation, which allows us to explicitly handle...
متن کاملWeakest Precondition for General Recursive Programs Formalized in Coq
This paper describes a formalization of the weakest precondition, wp, for general recursive programs using the type-theoretical proof assistant Coq. The formalization is a deep embedding using the computational power intrinsic to type theory. Since Coq accepts only structural recursive functions, the computational embedding of general recursive programs is non-trivial. To justify the embedding,...
متن کاملCategoricity Results for Second-Order ZF in Dependent Type Theory
We formalise the axiomatic set theory second-order ZF in the constructive type theory of Coq assuming excluded middle. In this setting we prove Zermelo’s embedding theorem for models, categoricity in all cardinalities, and the correspondence of inner models and Grothendieck universes. Our results are based on an inductive definition of the cumulative hierarchy eliminating the need for ordinals ...
متن کامل